package com.itlong.cloud.POJO.VO.app;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

/**
 * <desc>
 *      APP电梯设备信息VO类
 * </desc>
 *
 * @createDate 2017/10/23
 */
@Data
@NoArgsConstructor
public class AppFloorDevicesVO implements Serializable,Comparable<AppFloorDevicesVO>{
    private String deviceId;             //设备id
    private String deviceName;          //设备名称
    private String deviceUnique;        //设备唯一码
    private String projectId;           //项目编号
    private String protocolVersion;     //蓝牙协议版本
    private String threshold;           //开门阈值
    private String floorAuth;           //电梯权限值 可理解为当前用户在这栋楼的电梯所拥有的楼层权限 多个，号分隔
    private String cardNum;             //软卡号
    private String commonLogicalFloor; //待选公共楼层名称
    private String commonFloor;         //待选公共楼层
    private String liveFloor;           //待选居住楼层
    private String liveLogicalFloor;   //待选居住楼层名称
    private String commonChoiceFloor;   //已选常用公共楼层
    private String valiTime;             //有效时间
    private String liveChoiceFloor;     //已选常用居住楼层
    private String position;             //排序值
    private String batchNumber;         //批次号

    //云电梯新增
    private String codeName;    //电梯编号名称
    private String liftType;    //电梯设备类型  1为蓝牙电梯，2为云电梯
    private String groupConId;      //群控器id 无则返回设备序列号
    private String relatedDeviceId; //相关联的电梯ID，用”,”分割
    private Integer liftDoorType;   //正背门,0背门,1-正门
    private String doorDeviceUnique;    //绑定的门禁设备唯一码，多个逗号分隔
    private String elevatorFloor;       //对应电梯列表中naturalFloor，单层，多门禁按逗号分隔
    private String floors;
    private String floorsName;

    private String blueToothDevices;        //蓝牙外呼机号，多个，号分隔
    private String blueToothFloor;          //蓝牙外呼设备绑定楼层，多个，号分隔

    private String blueToothCallStandard;   //蓝牙进场呼梯状态：1开启,0关闭

    private String userCommonFloor; //常用楼层 json字符串，key为device_unique，value为natural_floor
    private String publicFloor; //常用公共楼层 json字符串，key为device_unique，value为natural_floor

    private String mainFloor;           //正门楼层，多个以逗号隔开
    private String backFloor;           //背门楼层，多个以逗号隔开
    /**
     * <desc>
     *      list排序重写方法
     * </desc>
     *
     * @param o
     * @return
     * @author Jiaqi.X
     * @cereateDate  2017/11/28
     */
    @Override
    public int compareTo(AppFloorDevicesVO o) {
        if(StringUtils.isNotBlank(this.getPosition()) && StringUtils.isNotBlank(o.getPosition())){
            if(Integer.valueOf(this.getPosition()) > Integer.valueOf(o.getPosition())){
                return 1;
            }else{
                return -1;
            }
        }
        if(StringUtils.isBlank(this.getPosition())&&StringUtils.isBlank(o.getPosition())){
            return -1;
        }else if(StringUtils.isNotBlank(o.getPosition())){
            return 1;
        }else{
            return -1;
        }
    }
}
